package sjtu.rfid.rri.services.management;

import java.util.List;

import javax.jws.WebService;

/**
 * The operation interface of ALE
 * 
 * @author jinghao
 * 
 */
@WebService
public interface ALEOperation {

	/**
	 * restart the ALE Server, which will clear all status of current ALE
	 * Server.
	 * 
	 */
	public void restartALEServer();

	/**
	 * restore ALE Server with the state before calling this function, this will
	 * restart the ale server.
	 * 
	 * @throws OperationException
	 *             if the operation failed to complete
	 */
	public void restoreALEServer();

	/**
	 * get a list of requested spec of ALEService
	 * 
	 * @param type
	 *            an enum type about the service type of ALE
	 * @return a list of requested spec of ALEService
	 * @throws OperationException
	 *             if the operation failed to complete
	 */
	public List<String> getALESpecList(ALEServiceType type);

	/**
	 * get the status of specified ALEService spec.
	 * 
	 * @param specName
	 *            the name of the spec
	 * @param type
	 *            an enum type about the service type of ALE
	 * @return the status of specified ALEService spec
	 * @throws OperationException
	 *             if the operation failed to complete
	 * @throws NoSuchSpecNameException
	 *             if there exist no such spec specified by the specName
	 */
	public String getALESpecStatus(String specName, ALEServiceType type)
			throws NoSuchSpecNameException;

	/**
	 * remove the specified ALEService spec.
	 * 
	 * @param specName
	 *            the name of the spec
	 * @param type
	 *            an enum type about the service type of ALE
	 * @throws OperationException
	 *             if the operation failed to complete
	 * @throws NoSuchSpecNameException
	 *             if there exist no such spec specified by the specName
	 */
	public void removeALESpec(String specName, ALEServiceType type)
			throws NoSuchSpecNameException;

}
